<%-- 
    Document   : content_favorite
    Created on : Jan 1, 2012, 12:54:08 AM
    Author     : Ngoc Linh
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div id="content-col">
    <h2 class="bid_header_title">Sản phẩm yêu thích</h2>
    <div id="mem_bidding">
        <div class="option_view">
            <div class="search_pro fl">
                <form action="#" method="get">
                    <label for="search_name">Từ khóa</label>
                    <input id="search_name" name="search_name" type="text" />
                    <input type="submit" value="Tìm" />
                </form>
            </div>
            <div class="mem_paging fr">
                <ul class="fl">
                    <c:if test="${soTrang > 0}" >
                        <c:forEach begin="1" end="${soTrang}" var="i">
                            <c:url value="favorite.do" var="favorite_link">
                                <c:param name="page" value="${i}" />
                            </c:url>
                            <li><a href="${favorite_link}" <c:if test="${page eq i}">class="selected"</c:if> >${i}</a></li>
                        </c:forEach>
                    </c:if>
                </ul>
            </div>
        </div>
        <p class="quaity_report" id="product_favorite">Tổng số sản phẩm yêu thích: <span class="quantiy_bid">${requestScope.listCount}</span></p>
        <table class="table_mem" id="history_bid" style="width: 674px;">
            <thead>
                <tr>
                    <td style="width: 25px;" class="center">
                        STT
                    </td>
                    <td>
                        Sản Phẩm
                    </td>                                    
                    <td style="width: 56px;" class="center">
                        Hình ảnh
                    </td>
                    <td style="width: 80px;" class="center">
                        Giá hiện tại
                    </td>
                    <td style="width: 60px;" class="center">
                        Tùy chọn
                    </td>
                </tr>
            </thead>
            <tbody>
                <c:if test="${not empty requestScope.dsSanPham}">
                    <c:forEach begin="0" end="${requestScope.dsSanPham.size() - 1}" var="i">
                        <c:set var="sp" value="${requestScope.dsSanPham[i]}"/>
                        <tr>
                            <td class="center">
                                ${i + 1}
                            </td>
                            <td>
                                <a target="_blank" title="Xem chi tiết sản phẩm" href="/DauGia/product.do?masp=${sp.maSanPham}">
                                    ${sp.tenSanPham}
                                </a>
                            </td>
                            <td class="center">
                                <a target="_blank" title="Xem chi tiết sản phẩm" href="/DauGia/product.do?masp=${sp.maSanPham}">
                                    <img src="/DauGia/${sp.hinhMoTa}" alt="" width="50" height="50" />
                                </a>
                            </td>
                            <td class="center">
                                <fmt:formatNumber pattern="###,###" value="${sp.giaHienTai}" /> đ
                            </td>
                            <td class="center">
                                <c:url value="favorite.do" var="dislike_link">
                                    <c:param name="dislike" value="${sp.maSanPham}" />
                                </c:url>
                                <a href="${dislike_link}" title="Không thích nữa" class="unlike">
                                    <img src="../images/dislike.png" alt="" />
                                </a>
                            </td>                                    
                        </tr>
                    </c:forEach>
                </c:if>
            </tbody>
        </table
    </div>
</div>


